
//Replication do file for "Sequencing the Peace: How the Order of Peace Agreement Implementation Can Reduce the Destabilizing Effects of Post-Accord Elections"

//Replicate Table 1: Descriptive Statistics
sum high_accomodation  high_demob post_accord elections_Accomodation dead_1000 sig_minor_war accomo_prov  post_accord demob_impl war_dur constrain5_7 peacekeeping  earlier_CPA infant_rate gdppcap_PPPINT_1000 armed_personnel conflict_type  net_aid_tensmil if exclude_cases==0 & year_count!=0

//Replicate Table 2

//Survival st Set for analysis
stset year_count, id(caseid) failure( sig_minor_war) origin(time year_count)

//Model 1
streg high_accomodation  dead_1000 earlier_CPA  war_dur  accomo_prov constrain5_7 peacekeeping conflict_type gdppcap_PPPINT_1000 if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time

//Model 2
streg   high_accomodation  post_accord high_demob  dead_1000  war_dur constrain5_7 peacekeeping conflict_type infant_rate net_aid_tensmil armed_personnel1000 if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time

//Model 3
streg  high_accomodation  high_demob post_accord elections_Accomodation dead_1000  war_dur   constrain5_7 peacekeeping conflict_type  if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time 

//Model 4
streg  high_accomodation  high_demob post_accord elections_Accomodation dead_1000  war_dur armed_personnel1000 constrain5_7 peacekeeping conflict_type  if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time 

//Model 5
streg  high_accomodation  demob_impl post_accord elections_Accomodation dead_1000  war_dur   constrain5_7 peacekeeping conflict_type  if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time


//Replicate Figure 1
streg  high_accomodation  high_demob post_accord elections_Accomodation dead_1000  war_dur   constrain5_7 peacekeeping conflict_type  if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time 

stcurve, survival at1(post_accordelections =0 high_accomodation=0 elections_Accomodation = 0) at2(post_accordelections =1 high_accomodation=0 elections_Accomodation = 0) at3(post_accordelections =0 high_accomodation=1 elections_Accomodation = 0)at4(post_accordelections =1 high_accomodation=1 elections_Accomodation = 1)

//Replicate lincom test based on Model 5
streg  1.high_accomodation 0.high_accomodation demob_impl 1.post_accord 0.post_accord 1.elections_Accomodation 0.elections_Accomodation dead_1000  war_dur   constrain5_7 peacekeeping conflict_type  if  exclude_cases==0 & year_count!=0, cluster (cowcode) d(w) time

//test
lincom (1.elections_Accomodation +1.post_accordelections + 1.high_accomodation) - 1.post_accordelections


**exclude_cases** variable in the data file represents accord years that are dropped from equations as implementation coding stopped due to a 1,000 battle deaths. 
**This variable also excludes future implementation years not yet coded.

